//
//  ZDLabel.m
//  0921仿网易新闻框架01
//
//  Created by Apple on 15/9/23.
//  Copyright (c) 2015年 itcast. All rights reserved.
//

#import "ZDLabel.h"

@implementation ZDLabel


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        //设置居中
        self.textAlignment = NSTextAlignmentCenter;
        
        //设置字体大小
        self.font = [UIFont systemFontOfSize:18];
        
        self.scale = 0;
    }
    
    return self;
}


- (void)setScale:(CGFloat)scale
{
    _scale = scale;
    
    //颜色根据scale值从黑色到红色渐变
    self.textColor = [UIColor colorWithRed:scale green:0 blue:0 alpha:1.0];
    
    CGFloat transformScale = 0.7 + 0.3 * scale;    //scale从0到1之间变化
    
    self.transform = CGAffineTransformMakeScale(transformScale, transformScale);
}

@end
